package com.shangxian.giveithome.entity.community;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 发布表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Issue {
    /**
     * 发布的id
     */
    private Long id;

    /**
     * 发布的内容
     */
    private String content;

    /**
     * 图片组id
     */
    private Long imgId;

    /**
     * 发布的类型
     */
    private String type;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 合集id
     */
    private Long collectionId;

    /**
     * 发布时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date issueTime;

    /**
     *
     * @param issue 文章浏览数量
     */
    private long LookNumber;

    /**
     * 是否删除  0 未删除   1删除
     * @param issue
     */
    private long state;

    /**
     *
     * @param issue
     */

    public Issue(Issue issue){
        this.id  = issue.getId();
        this.collectionId = issue.getCollectionId();
        this.content = issue.getContent();
        this.imgId = issue.getImgId();
        this.issueTime = issue.getIssueTime();
        this.type = issue.getType();
        this.userId = issue.getUserId();
    }

}
